home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / ACGIFREE.ZIP / INCLUDE / A_STRUCT.H < prev   
Encoding:
C/C++ Source or Header  |  1996-08-08  |  2.2 KB  |  65 lines

  1. //////////////////////////////////////////////////////////
  2. // Structure definitions
  3. //////////////////////////////////////////////////////////
  4.  
  5. #ifndef __A_STRUCT_H__
  6. #define __A_STRUCT_H__
  7.  
  8. //a_CRC Model structure
  9. //a_Initialized to the CRC constants upon call to one of the CRC functions
  10. //a_You can pass it a pointer to your own struct. I used the values in the article. 
  11. typedef struct  tagCRCMODEL
  12. {
  13.   int   iWidth;    //Width in bits [8,32]
  14.   DWORD dwPoly;    //The algorithm's polynomial.
  15.   DWORD dwInit;    //Initial register value.
  16.   BYTE  bRefIn;    //Reflect input bytes?
  17.   BYTE  bRefOut;    //Reflect output CRC?
  18.   DWORD dwXOROut;  //XOR this to output CRC.
  19.  
  20.   DWORD dwReg;     //Context during execution.
  21.  
  22.   //a_Initialization
  23.   void Init(void) { dwReg = dwInit; }
  24.  
  25. } CRCMODEL, *PCRCMODEL;
  26.  
  27.  
  28. //a_Parameters for outputting characters
  29. typedef struct tagTEXTOUT
  30. {
  31.   const char *pccText;          //a_Output text (will be mapped thorogh the character set and then blitted)
  32.   int         iTextLength;      //a_Length of the output text
  33.   int         iPX, iPY;         //a_Starting offset for the line
  34.   int         iSpacing;         //a_Intercharacter spacing
  35.   int         iBaseline;        //a_How far from top of line is the basline (NOTE: too low may clip against iLineHeight)
  36.   int         iLineHeight;      //a_Height of the line
  37.   int         iMode;            //a_Method of blitting
  38.   int         iAlign;           //a_Align (left or right)
  39.  
  40.   tagTEXTOUT(const char *pccX = NULL, int iLength = -0x1)
  41.   {
  42.     if (pccX)
  43.     {
  44.       //a_Basic string assign
  45.       pccText = pccX;
  46.       if (iLength > 0x0) iTextLength = iLength;
  47.       else iTextLength = strlen(pccX);
  48.       
  49.     }
  50.     else
  51.     {
  52.       pccText = NULL;
  53.       iTextLength = 0x0;                       //a_No default text
  54.     }
  55.  
  56.     iMode = BLIT_COPY;                         //a_Copy by default
  57.     iPX = iPY = 0x0;                           //a_Assume start at 0,0
  58.     iSpacing = 0x1;                            //a_Default character spacing
  59.     iBaseline = iLineHeight = -0x1;            //a_Not set
  60.     iAlign = HALIGN_LEFT;                      //a_See predef.h (constant used in other places)
  61.   }
  62. } TEXTOUT;
  63.  
  64. #endif
  65.